package shapes;

import java.awt.Point;

/**
 * Straight connector
 */
public class StraightConnector extends Line implements Connector {
	
	/* State variables */
	protected ConnPoint _fromCpt;
	protected ConnPoint _toCpt;
	
	/* Initialize connector */
	public StraightConnector(ConnPoint from, ConnPoint to) {
		super(null, null);
		_fromCpt = from;
		_toCpt = to;
	}
	
	/* Get start point */
	public Point getPointA() {
		return getStart();
	}
	
	/* Get end point */
	public Point getPointB() {
		return getEnd();
	}
	
	public Point getStart() {
		return _fromCpt.getSnapPoint(_toCpt.getTargetPoint());
	}
	
	public Point getEnd() {
		return _toCpt.getSnapPoint(_fromCpt.getTargetPoint());
	}
}